{% extends "jqmobile/base.html" %}
{% load i18n jqmobile_tags %}
        

{% block app.title %}
	{% trans "Admin" %} / {{ app_label.title|escape }}
{% endblock %}

{% block navbar %}
	{% get_breadcrumb request.path %}
{% endblock %}

{% block app.header_right_button %}
 	<a data-theme="b" data-iconpos="left" data-icon="plus" href="add/" class="ui-btn-right">{% trans 'Add' %}</a>
{% endblock %}

{% block content %}
{% spaceless %}
	<ul data-role="listview" data-inset="true" data-theme="a" data-dividertheme="a">
        <li class="group" data-theme="a">{{ cl.opts.verbose_name_plural|capfirst|escape }}<p class="ui-li-count">{{ cl.result_count }}</p></li>
        {% if cl.search_fields %}
        <li data-theme="c">{% search_form cl %}</li>
        {% endif %} 
		{% for res in cl.result_list %}
		<li data-theme="c"><a href="{{ res.id }}/" id="obj_{{ res.id }}">{{ res|escape }}</a></li>
		{% endfor %}
        <li>
            {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name|capfirst }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}
            <p class="ui-li-count">{{ cl.result_count }}</p>
        </li>
	</ul>
    {% pagination cl %}
{% endspaceless %}
{% endblock %}

{% comment %}
<div id="ma-listfilters" data-role="page" data-theme="a" >
     <div data-theme="a" data-role="header" class="ui-bar-a ui-header" role="banner">
        <a data-icon="back" href="{{ request.path }}" data-role="button" class="ui-btn-left">{% trans "Back" %}</a>
        <h1 tabindex="0" role="heading" aria-level="1" data-theme="a">{% trans 'Django administration' %}</h1>
    </div>
    <div data-role="content">
        

            {% comment %}
            {% if cl.search_fields or cl.has_filters or cl.date_hierarchy %}
                <div class="module changelist-filters">

                    <!-- PAGINATION TOP -->
                    {% pagination cl %}

                    {% if cl.has_filters or cl.search_fields %}

                        <!-- FILTERS -->
                        {% if cl.has_filters %}
                            <div id="filters" class="module filter span-6">
                                <div class="pulldown-container">
                                    <a href="javascript://" class="button toggle-filters">{% trans 'Filter' %}</a>
                                    <div class="filter-pulldown">
                                        {% for spec in cl.filter_specs %}
                                            {% admin_list_filter cl spec %}
                                        {% endfor %}
                                    </div>
                                </div>
                            </div>
                        {% endif %}


                        <!-- SEARCH -->
                        {% if cl.search_fields %}
                            <div id="search" class="module search span-6">
                                {% block search %}{% search_form cl %}{% endblock %}
                            </div>
                        {% endif %}

                    {% endif %}
                    <br clear="all" />
                </div>

                <!-- DATE HIERARCHY -->
                {% if cl.date_hierarchy %}
                    {% date_hierarchy cl %}
                {% endif %}

            {% endif %}
            {% endcomment %}
        
            {% comment %}
            {% if cl.has_filters %}
            <div id="filters" class="module filter span-6">
                {# <div class="pulldown-container"> #}
                <ul data-role="listview" data-inset="true" data-theme="a" data-dividertheme="a">
                    <li class="group" id="verbose_name" data-theme="a">{% trans 'Filter' %}</a></li>
                    {# <div class="filter-pulldown"> #}
                    {% for spec in cl.filter_specs %}
                        <li data-theme="c">{% admin_list_filter cl spec 1 %}</li>
                    {% endfor %}
                    {# </div> #}
                </ul>
                {# </div> #}
            </div>
            {% endif %}
            {% endcomment %}
            
            {% comment %}
    </div>
</div>
{% endcomment %}

{% comment %}
<div id="ma-listsearch" data-role="page" data-theme="a" >
     <div data-theme="a" data-role="header" class="ui-bar-a ui-header" role="banner">
        <a data-icon="back" href="{{ request.path }}" data-role="button" class="ui-btn-left">{% trans "Back" %}</a>
        <h1 tabindex="0" role="heading" aria-level="1" data-theme="a">{% trans 'Django administration' %}</h1>
    </div>

    <div data-role="fieldcontain">
        <label for="search">{% trans "Search" %}</label>
        {% if cl.search_fields %}
        <div id="search" class="module search span-6">
            {# {% block search %}{% search_form cl 0 %}{% endblock %} #}
            <form id='changelist-search' methode="get" action='' > 
                <input type="search" name="search" id="search" value="" /> 
                <input type="submit" value="{% trans "Valider" %}"/>
            </form>
        </div>
    {% endif %}
    </div>
</div>
{% endcomment %}

